package backpropagationv1;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Scanner;

public class leerArchivo {

    public leerArchivo(ArrayList<Float> _data){
        this.data = _data;
    }

    public void leer() throws FileNotFoundException{
        Scanner s = new Scanner (new File("./data2.txt"));

            while (s.hasNextLine()){
                for (int j=0;j<4;j++){
                         f = s.nextFloat();
                         data.add(f);
                         if (j == 3) s.nextLine();
                         else s.skip("\t");
                }
            }
    }

    public float getVal(int row, int col){
        row = row*4;
        if(col<4)return data.get(row+col);
        else System.out.println("Error val col"); return 0;
    }

    private float f;
    private ArrayList<Float> data;
}
